import { request } from '../../../../services/request';

// 获取用户积分接口
export const getUserScoreApi = async (workMonth: string) => {
    try {
        const response = await request('app/work/getUserScore', {
            method: 'POST',
            body: JSON.stringify({
                work_month: workMonth
            })
        });
        return response;
    } catch (error) {
        console.error('获取个人中心数据失败:', error);
        throw error;
    }
};

// 获取工作记录接口
export const getWorkRecordsApi = async (params: {
    work_month: string;
    size: number;
    current: number;
}) => {
    try {
        const response = await request('app/work/searchMesWork', {
            method: 'POST',
            body: JSON.stringify(params)
        });
        return response;
    } catch (error) {
        console.error('获取工作记录失败:', error);
        throw error;
    }
};
